package org.example.order.domain;

public class OrderDomainException extends RuntimeException {
    private static final long serialVersionUID = 349742290011407561L;
    private final transient ErrorCode errorCode;
    private final transient Object[] args;

    public OrderDomainException(ErrorCode errorCode, Object... args) {
        super(errorCode.getMessage(args));
        this.errorCode = errorCode;
        this.args = args;
    }

    public String getCode() {
        return errorCode.getCode();
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public Object[] getArgs() {
        return args;
    }
}
